#ifndef __CE_GFX_MATERIAL_H__
#define __CE_GFX_MATERIAL_H__

#include <export.h>
#include <asset/asset.h>
#include <gfx/enum.h>
#include <gfx/sharedshaderbinding.h>
#include <gfx/texturepack.h>
#include <math/color.h>

/**
 * \addtogroup graphics
 * @{
 */
/**
 * @brief Basic parameter of a material
 */
struct ceMaterialSpec
{
  ceColor4f   Ambient;
  ceColor4f   Diffuse;
  ceColor4f   Specular;
  float       Shininess;
  ceColor4f   Emission;

  bool        Transparency;
  bool        WriteDepth;
  bool        TestDepth;
  bool        Unlit;
};

struct iEffect;
struct iTexture;
/**
 * @brief Complete collection of data for a material
 */
class CE_API ceMaterial : public ceAsset
{
	CE_ASSET_ID3('m', 'a', 't')
  CE_OBJECT
private:
	
	iEffect													*_effect;
  ceTexturePack                   _textures;
  ceMaterialSpec                  _materialSpec;
  ceSharedShaderBinding						_sharedBindings;

public:
  ceMaterial();
  virtual ~ceMaterial();

  void SetEffect (iEffect* effect);
  iEffect* GetEffect ();
  const iEffect* GetEffect () const;

  const ceTexturePack* GetTextures() const;
  ceTexturePack* GetTextures();

  const ceMaterialSpec& GetMaterialSpec () const;
  ceMaterialSpec& GetMaterialSpec ();

  const ceSharedShaderBinding& GetSharedShaderBinding () const;
  ceSharedShaderBinding& GetSharedShaderBinding ();

  void SetTexture (ceRenderPass rp, ceTextureStage stage, iTexture* texture);

};

/** @} */

#endif /* ! __CE_GFX_MATERIAL_H__ */

